﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SarkothFarmer;
using Zeta;
using Zeta.Common;
using Zeta.CommonBot;
using Zeta.Internals.Actors;

namespace SarkothFarmer.ClassSpecifics
{
    class WitchDoctor : Common
    {
        public override void FastMoveTo(Vector3 v)
        {
            MoveTo(v);
            if (ZetaDia.Me.HasBuff(SNOPower.Witchdoctor_SpiritWalk) || ZetaDia.Me.HasBuff(SNOPower.Witchdoctor_Horrify))
                return;
            if (ZetaDia.Me.Movement.IsMoving)
            {
                if (PowerManager.CanCast(SNOPower.Witchdoctor_SpiritWalk))
                {
                    UsePowerSelf(SNOPower.Witchdoctor_SpiritWalk);
                }
                else if (PowerManager.CanCast(SNOPower.Witchdoctor_Horrify))
                {
                    UsePowerSelf(SNOPower.Witchdoctor_Horrify);
                }
            }
        }
        protected override bool SafeTP()
        {
            if (PowerManager.CanCast(SNOPower.Witchdoctor_FetishArmy))
            {
                UsePowerSelf(SNOPower.Witchdoctor_FetishArmy);
            }
            if (Helpers.Composites.IsUnitNear(Main.settingsWrapper.SafeTPDistance) && PowerManager.CanCast(SNOPower.Witchdoctor_WallOfZombies))
            {
                Vector3 location =
                    Helpers.Composites.VectorWithDistanceFrom(Helpers.Objects.Units.FirstOrDefault().Position, 15);
                UsePowerAt(SNOPower.Witchdoctor_WallOfZombies, location);
            }
            return base.SafeTP();
        }
        public override void PreCombat()
        {
            UsePowerSelf(SNOPower.Witchdoctor_FetishArmy);
            UsePowerSelf(SNOPower.Witchdoctor_Gargantuan);
            base.PreCombat();
        }
        public override int KillRadius
        {
            get { return 40; }
        }
    }
}
